#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    ll n, id, k;
    cin >> n >> id >> k;
    vector<ll> a(n + 1);
    for (ll i = 1; i <= n; i++)
    {
        cin >> a[i];
    }

    ll now = a[id];
    sort(a.begin() + 1, a.end());
    // cout << now << ":";
    if(a[n]>now)
    {
        if(k>=2)
        {
            yes;
        }
        else {
            no;
        }
    }
    else {
        if(k>=1)
        {
            yes;
        }
        else
            no;
    }
   // cout << "no" << endl;
}
int main()
{
    int t = 1;
    cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
